package com.myspring.controller;

import com.myspring.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//根据文章id删除文章
@Controller
@RequestMapping(value = {"/mycontroller4"})
public class MyController4 {
    @Autowired
    private MyService myService;

    @RequestMapping(value = "/mymethod4/{id}")
    public ResponseEntity<Boolean> mymethod4 (@PathVariable(value = "id") Integer id ) throws  Exception{
        this.myService.deleteById(id);
        return  new ResponseEntity<Boolean>(true,HttpStatus.OK);
    }
}
